[dotnet] [bidi] Decouple EvaluateResult in Script module#15493
[dotnet] [bidi] Decouple EvaluateResult in Script module#15493nvborisenko merged 1 commit intoSeleniumHQ:trunkfrom
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
RenderMichael
left a comment
There was a problem hiding this comment.
These changes look good as part of the effort to remove nested DTOs.
In a future PR, we can change the EvaluateAsync/CallFunctionAsync to return EvaluateResult directly instead of throwing/returning success.
User description
Following spec https://w3c.github.io/webdriver-bidi/#type-script-EvaluateResult
I chose
EvaluateResultSuccessinstead of commonly usedSuccessEvaluateResult, preferred the same in spec.Motivation and Context
Contributes to #15407
Types of changes
Checklist
PR Type
Enhancement
Description
Replaced nested DTO types with standalone types for better extensibility.
Updated
EvaluateResultstructure to useEvaluateResultSuccessandEvaluateResultException.Adjusted serialization and deserialization logic to align with new DTO structure.
Refactored related methods and exception handling to use updated DTO types.
Changes walkthrough 📝
BiDiJsonSerializerContext.cs
Updated JSON serialization for new DTO typesdotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs
EvaluateResultSuccessandEvaluateResultException.EvaluateResultConverter.cs
Updated deserialization logic for new DTO typesdotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/EvaluateResultConverter.cs
EvaluateResultSuccessandEvaluateResultException.BrowsingContextScriptModule.cs
Refactored methods to use new DTO typesdotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextScriptModule.cs
EvaluateResultSuccess.EvaluateCommand.cs
Refactored EvaluateCommand to use standalone DTOsdotnet/src/webdriver/BiDi/Modules/Script/EvaluateCommand.cs
EvaluateResulttypes with standaloneEvaluateResultSuccessandEvaluateResultException.EvaluateResultSuccess.ScriptEvaluateException.cs
Updated exception handling for new DTO structuredotnet/src/webdriver/BiDi/Modules/Script/ScriptEvaluateException.cs
EvaluateResultException.ScriptModule.cs
Refactored ScriptModule methods for new DTO typesdotnet/src/webdriver/BiDi/Modules/Script/ScriptModule.cs
EvaluateResultSuccessandEvaluateResultException.